package com.todo.member.infrastructure.repository;


import com.todo.member.common.enums.MemberVipBoughtStatusEnum;
import com.todo.member.infrastructure.entity.po.MemberVipOrderPO;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/11 11:17
 * @description
 */
public interface MemberVipOrderRepository {

    /**
     * 插入会员关系
     *
     * @param memberVipOrderPO
     * @return
     */
    Boolean insertMemberVipRelationPO(MemberVipOrderPO memberVipOrderPO);

    /**
     * 根据主键删除会员关系
     *
     * @param id
     * @return
     */
    Boolean removeMemberVipRelationPOById(Long id);

    /**
     * 根据主键查询会员关系
     *
     * @param id
     * @return
     */
    MemberVipOrderPO queryMemberVipRelationPOById(Long id);

    /**
     * 根据主键更新会员关系状态
     *
     * @param id
     * @param oldStatus
     * @param newStatus
     * @return
     */
    Boolean updateMemberVipRelationStatusById(Long id, MemberVipBoughtStatusEnum oldStatus, MemberVipBoughtStatusEnum newStatus);

    /**
     * 根据用户id查询会员关系
     *
     * @param userId
     * @param status
     * @return
     */
    List<MemberVipOrderPO> queryMemberVipRelationByUserId(@NotNull Long userId, MemberVipBoughtStatusEnum status);
}
